﻿#region Using statements
using System;
using System.Linq;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using SmartFrequency.Utils;
#endregion

namespace SmartFrequency.GUI
{
    public partial class MainSettings : Form
    {
        #region Private variables
        private Language FromLanguage;
        private Settings PSettings;
        private Utilities PUtils = new Utilities();
        #endregion

        public MainSettings()
        {
            InitializeComponent();

            this.Text = PUtils.Version;
            PSettings = new Settings("settings.txt");
            PSettings.Load();

            switch (PSettings.GetMember("language"))
            {
                default:
                case "tr":
                case "TR":
                    FromLanguage = new Language(Language.Language_e.TR);
                    label1.Left += 10;
                    break;
                case "ENG":
                case "eng":
                    FromLanguage = new Language(Language.Language_e.ENG);
                    //label1.Left += 5;
                    break;
            }

            label1.Text = FromLanguage.FrmMsgToString(Language.FormMsg_e.FORM8_HEAD);
            menuItem2.Text = FromLanguage.FrmMsgToString(Language.FormMsg_e.MENU7_TEXT);
        }

        private void MainSettings_Paint(object sender, PaintEventArgs e)
        {
            /*
            Graphics gfx = e.Graphics;
            GRoundedRectangles roundButtons = new GRoundedRectangles();
            roundButtons.SetGFX(gfx);
            roundButtons.SetColors(Color.Black, Color.Gray, Color.White, Color.White);
            roundButtons.SetFontStyle("Tahoma", 10, FontStyle.Bold);

            roundButtons.AddButton(15, 40, 190, 40, FromLanguage.FrmMsgToString(Language.FormMsg_e.FORM3_HEAD), new GRoundedRectangles.functionPointer(GeneralSettings_Press));
            //roundButtons.AddButton(15, 90, 190, 40, FromLanguage.FrmMsgToString(Language.FormMsg_e.FORM2_HEAD), new GRoundedRectangles.functionPointer(RecorderSettings_Press));
            //roundButtons.AddButton(15, 140, 190, 40, FromLanguage.FrmMsgToString(Language.FormMsg_e.FORM7_HEAD), new GRoundedRectangles.functionPointer(FileManagerSettings_Press));

            roundButtons.Draw();
            roundButtons.PerformFunction(MousePosition.X, MousePosition.Y);
            */
        }

        public void GeneralSettings_Press()
        {
            GeneralSettings gSettings = new GeneralSettings();
            gSettings.Show();
        }

        private void menuItem2_Click(object sender, EventArgs e)
        {
            Dispose();
        }
    }
}